﻿@model S4Store.Models.Markting.DTHDHistoryModel
@{
    Layout = null;
    ViewBag.Title = "DTHDHistory";

    S4Store.Models.Chart.Line ChartModel1 = new S4Store.Models.Chart.Line();
    ChartModel1.Name = "店头活动计划执行率";
    ChartModel1.YAxis = "比率(%)";
    S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标执行率";
    S4Store.Models.Chart.ChartSeries series2= new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际执行率";
    ChartModel1.Serieses.Add(series1);
    ChartModel1.Serieses.Add(series2);
    for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
    {
        ChartModel1.XAxis.Add(dt.ToString("M月"));
        var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
        series1.Data.Add(report.ExhibitionKpiStandard.DTHDJHZXLV);
        series2.Data.Add(report.DTHDJHZXLV);
    }


    S4Store.Models.Chart.Line ChartModel2 = new S4Store.Models.Chart.Line();
    ChartModel2.Name = "店头活动策划案成稿率";
    ChartModel2.YAxis = "比率(%)";
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标成稿率";
    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际成稿率";
    ChartModel2.Serieses.Add(series1);
    ChartModel2.Serieses.Add(series2);

    for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
    {
        ChartModel2.XAxis.Add(dt.ToString("M月"));
        var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
        series1.Data.Add(report.ExhibitionKpiStandard.DTHDCHCGLV);
        series2.Data.Add(report.DTHDCHCGLV);
    }


    S4Store.Models.Chart.Line ChartModel3 = new S4Store.Models.Chart.Line();
    ChartModel3.Name = "店头活动效果评估率";
    ChartModel3.YAxis = "比率(%)";
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标执行率";
    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际执行率";
    ChartModel3.Serieses.Add(series1);
    ChartModel3.Serieses.Add(series2);

    for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
    {
        ChartModel3.XAxis.Add(dt.ToString("M月"));
        var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
        series1.Data.Add(report.ExhibitionKpiStandard.DTHDXGPGLV);
        series2.Data.Add(report.DTHDXGPGLV);
    }

    S4Store.Models.Chart.Line ChartModel4 = new S4Store.Models.Chart.Line();
    ChartModel4.Name = "单次客户集客成本";
    ChartModel4.YAxis = "万元";
    ChartModel4.IsRate = false;
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标集客成本";
    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际集客成本";
    ChartModel4.Serieses.Add(series1);
    ChartModel4.Serieses.Add(series2);

    for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
    {
        ChartModel4.XAxis.Add(dt.ToString("M月"));
        var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
        series1.Data.Add(report.ExhibitionKpiStandard.DTHDDCKHJKCB);
        series2.Data.Add(report.DTHDDCKHJKCB);
    }

    S4Store.Models.Chart.Line ChartModel5 = new S4Store.Models.Chart.Line();
    ChartModel5.Name = "活动邀约成功率";
    ChartModel5.YAxis = "比率(%)";
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标邀约成功率";
    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际邀约成功率";
    ChartModel5.Serieses.Add(series1);
    ChartModel5.Serieses.Add(series2);

    for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
    {
        ChartModel5.XAxis.Add(dt.ToString("M月"));
        var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
        series1.Data.Add(report.ExhibitionKpiStandard.ZTHDYYCGLV);
        series2.Data.Add(report.ZTHDYYCGLV);
    }

    S4Store.Models.Chart.Line ChartModel6 = new S4Store.Models.Chart.Line();
    ChartModel6.Name = "战败客户二次消化率";
    ChartModel6.YAxis = "比率(%)";
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标消化率";
    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际消化率";
    ChartModel6.Serieses.Add(series1);
    ChartModel6.Serieses.Add(series2);

    for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
    {
        ChartModel6.XAxis.Add(dt.ToString("M月"));
        var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
        series1.Data.Add(report.ExhibitionKpiStandard.DTHDZBKECXHLV);
        series2.Data.Add(report.DTHDZBKECXHLV);
    }
}
<div style="height:100%; width:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div class="pageContent">
	
	<div class="tabs" currentIndex="0" eventType="click">
		<div class="tabsHeader">
			<div class="tabsHeaderContent">
				<ul>
					<li><a href="javascript:;"><span>店头活动计划执行率</span></a></li>
					<li><a href="javascript:;"><span>店头活动策划案成稿率</span></a></li>
					<li><a href="javascript:;"><span>店头活动效果评估率</span></a></li>
					<li><a href="javascript:;"><span>单次客户集客成本</span></a></li>
					<li><a href="javascript:;"><span>活动邀约成功率</span></a></li>
					<li><a href="javascript:;"><span>战败客户二次消化率</span></a></li>
				</ul>
			</div>
		</div>
		<div class="tabsContent" >
			<div>
            @Html.Partial("../Chart/Line", ChartModel1)
			</div>
			<div>
            @Html.Partial("../Chart/Line", ChartModel2)
			</div>
            <div>
            @Html.Partial("../Chart/Line", ChartModel3)
			</div>
            <div>
            @Html.Partial("../Chart/Line", ChartModel4)
			</div>
            <div>
            @Html.Partial("../Chart/Line", ChartModel5)
			</div>
            <div>
            @Html.Partial("../Chart/Line", ChartModel6)
			</div>
		</div>
		<div class="tabsFooter">
			<div class="tabsFooterContent"></div>
		</div>
	</div>
</div>

</div>
